package com.glsc.ngateway.common.base.domain.postgre6;

import com.alibaba.excel.annotation.ExcelProperty;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * @author: qiyr
 * @date: 2023/4/4 11:08
 * @description: 中信TRS估值表
 */
@Data
@Entity
@Table(name = "t_excel_trs_citics_gzb")
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonIgnoreProperties({"hibernateLazyInitializer", "handler"})
@IdClass(TrsCiticsGzb.PK.class)
public class TrsCiticsGzb {

    public static class PK implements Serializable {
        private String date;
        private String contractid;

        public String getDate() {
            return date;
        }

        public void setDate(String date) {
            this.date = date;
        }

        public String getContractid() {
            return contractid;
        }

        public void setContractid(String contractid) {
            this.contractid = contractid;
        }

        @Override
        public boolean equals(Object o) {
            if (this == o) return true;
            if (o == null || getClass() != o.getClass()) return false;
            PK pk = (PK) o;
            return Objects.equals(date, pk.date) && Objects.equals(contractid, pk.contractid);
        }

        @Override
        public int hashCode() {
            return Objects.hash(date, contractid);
        }
    }

    @Id
    @Column(name = "fc_date")
    @ExcelProperty("估值日期")
    private String date;

    @Id
    @Column(name = "fc_contractid")
    @ExcelProperty("合约代码")
    private String contractid;

    @Column(name = "fc_status")
    @ExcelProperty("合约状态")
    private String status;

    @Column(name = "fc_direction")
    @ExcelProperty("客户方向")
    private String direction;

    @Column(name = "fc_asset")
    @ExcelProperty("标的资产")
    private String asset;

    @Column(name = "fc_code")
    @ExcelProperty("标的代码")
    private String code;

    @Column(name = "ff_net_price_begin")
    @ExcelProperty("期初净价")
    private Double netPriceBegin;

    @Column(name = "ff_full_price_begin")
    @ExcelProperty("期初全价")
    private Double fullPriceBegin;

    @Column(name = "ff_net_price")
    @ExcelProperty(value = "估值日净价")
    private Double netPrice;

    @Column(name = "ff_full_price")
    @ExcelProperty(value = "估值日全价")
    private Double fullPrice;

    @Column(name = "ff_principal")
    @ExcelProperty("名义金额（美元）")
    private Double principal;

    @Column(name = "ff_val_begin")
    @ExcelProperty("期初市值(美元）")
    private Double valBegin;

    @Column(name = "ff_margin_ratio")
    @ExcelProperty("保证金比例")
    private Double marginRatio;

    @Column(name = "ff_yfj_begin")
    @ExcelProperty("期初预付金（元）")
    private Double yfjBegin;

    @Column(name = "ff_margin_rate")
    @ExcelProperty("保证金利率")
    private Double marginRate;

    @Column(name = "ff_rate_begin")
    @ExcelProperty("期初汇率")
    private Double rateBegin;


    @Column(name = "ff_rate")
    @ExcelProperty("估值日汇率")
    private Double rate;


    @Column(name = "fc_trade_date")
    @ExcelProperty("交易达成日")
    private String tradeDate;


    @Column(name = "fc_begin_date")
    @ExcelProperty("起始日")
    private String beginDate;


    @Column(name = "fc_end_date")
    @ExcelProperty("到期日")
    private String endDate;


    @Column(name = "ff_yfrzcb")
    @ExcelProperty("乙方融资成本")
    private Double yfrzcb;


    @Column(name = "ff_coupons_total")
    @ExcelProperty("累计票息（元）")
    private Double couponsTotal;


    @Column(name = "ff_gdrz_interest")
    @ExcelProperty("固定融资利息（元）")
    private Double gdrzInterest;


    @Column(name = "ff_yfj_interest")
    @ExcelProperty("预付金利息（元）")
    private Double yfjInterest;


    @Column(name = "ff_net_val")
    @ExcelProperty("估值日净价市值（美元）")
    private Double netVal;


    @Column(name = "ff_bond_net_pl")
    @ExcelProperty("债券净价变动盈亏（元）")
    private Double bondNetPl;


    @Column(name = "ff_trs_val")
    @ExcelProperty("TRS合约价值")
    private Double trsVal;


    @Column(name = "ff_trs_pl")
    @ExcelProperty("TRS合约盈亏")
    private Double trsPl;

    @Column(name = "ff_ytm")
    @ExcelProperty("到期收益率")
    private Double ytm;

    @Column(name = "ff_modified")
    @ExcelProperty("久期")
    private Double modified;

    @Column(name = "ff_bond_dvbp")
    @ExcelProperty("基点价值")
    private Double dvbp;

    public TrsCiticsGzb() {
    }

    public TrsCiticsGzb(String date, String contractid, String status, String direction, String asset, String code,
                        Double netPriceBegin, Double fullPriceBegin, Double netPrice, Double fullPrice,
                        Double principal, Double valBegin, Double marginRatio, Double yfjBegin, Double marginRate,
                        Double rateBegin, Double rate, String tradeDate, String beginDate, String endDate,
                        Double yfrzcb, Double couponsTotal, Double gdrzInterest, Double yfjInterest, Double netVal,
                        Double bondNetPl, Double trsVal, Double trsPl, Double ytm, Double modified, Double dvbp) {
        this.date = date;
        this.contractid = contractid;
        this.status = status;
        this.direction = direction;
        this.asset = asset;
        this.code = code;
        this.netPriceBegin = netPriceBegin;
        this.fullPriceBegin = fullPriceBegin;
        this.netPrice = netPrice;
        this.fullPrice = fullPrice;
        this.principal = principal;
        this.valBegin = valBegin;
        this.marginRatio = marginRatio;
        this.yfjBegin = yfjBegin;
        this.marginRate = marginRate;
        this.rateBegin = rateBegin;
        this.rate = rate;
        this.tradeDate = tradeDate;
        this.beginDate = beginDate;
        this.endDate = endDate;
        this.yfrzcb = yfrzcb;
        this.couponsTotal = couponsTotal;
        this.gdrzInterest = gdrzInterest;
        this.yfjInterest = yfjInterest;
        this.netVal = netVal;
        this.bondNetPl = bondNetPl;
        this.trsVal = trsVal;
        this.trsPl = trsPl;
        this.ytm = ytm;
        this.modified = modified;
        this.dvbp = dvbp;
    }

    public String getDate() {
        return date;
    }

    public void setDate(String date) {
        this.date = date;
    }

    public String getContractid() {
        return contractid;
    }

    public void setContractid(String contractid) {
        this.contractid = contractid;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getDirection() {
        return direction;
    }

    public void setDirection(String direction) {
        this.direction = direction;
    }

    public String getAsset() {
        return asset;
    }

    public void setAsset(String asset) {
        this.asset = asset;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public Double getNetPriceBegin() {
        return netPriceBegin;
    }

    public void setNetPriceBegin(Double netPriceBegin) {
        this.netPriceBegin = netPriceBegin;
    }

    public Double getFullPriceBegin() {
        return fullPriceBegin;
    }

    public void setFullPriceBegin(Double fullPriceBegin) {
        this.fullPriceBegin = fullPriceBegin;
    }

    public Double getNetPrice() {
        return netPrice;
    }

    public void setNetPrice(Double netPrice) {
        this.netPrice = netPrice;
    }

    public Double getFullPrice() {
        return fullPrice;
    }

    public void setFullPrice(Double fullPrice) {
        this.fullPrice = fullPrice;
    }

    public Double getPrincipal() {
        return principal;
    }

    public void setPrincipal(Double principal) {
        this.principal = principal;
    }

    public Double getValBegin() {
        return valBegin;
    }

    public void setValBegin(Double valBegin) {
        this.valBegin = valBegin;
    }

    public Double getMarginRatio() {
        return marginRatio;
    }

    public void setMarginRatio(Double marginRatio) {
        this.marginRatio = marginRatio;
    }

    public Double getYfjBegin() {
        return yfjBegin;
    }

    public void setYfjBegin(Double yfjBegin) {
        this.yfjBegin = yfjBegin;
    }

    public Double getMarginRate() {
        return marginRate;
    }

    public void setMarginRate(Double marginRate) {
        this.marginRate = marginRate;
    }

    public Double getRateBegin() {
        return rateBegin;
    }

    public void setRateBegin(Double rateBegin) {
        this.rateBegin = rateBegin;
    }

    public Double getRate() {
        return rate;
    }

    public void setRate(Double rate) {
        this.rate = rate;
    }

    public String getTradeDate() {
        return tradeDate;
    }

    public void setTradeDate(String tradeDate) {
        this.tradeDate = tradeDate;
    }

    public String getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(String beginDate) {
        this.beginDate = beginDate;
    }

    public String getEndDate() {
        return endDate;
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public Double getYfrzcb() {
        return yfrzcb;
    }

    public void setYfrzcb(Double yfrzcb) {
        this.yfrzcb = yfrzcb;
    }

    public Double getCouponsTotal() {
        return couponsTotal;
    }

    public void setCouponsTotal(Double couponsTotal) {
        this.couponsTotal = couponsTotal;
    }

    public Double getGdrzInterest() {
        return gdrzInterest;
    }

    public void setGdrzInterest(Double gdrzInterest) {
        this.gdrzInterest = gdrzInterest;
    }

    public Double getYfjInterest() {
        return yfjInterest;
    }

    public void setYfjInterest(Double yfjInterest) {
        this.yfjInterest = yfjInterest;
    }

    public Double getNetVal() {
        return netVal;
    }

    public void setNetVal(Double netVal) {
        this.netVal = netVal;
    }

    public Double getBondNetPl() {
        return bondNetPl;
    }

    public void setBondNetPl(Double bondNetPl) {
        this.bondNetPl = bondNetPl;
    }

    public Double getTrsVal() {
        return trsVal;
    }

    public void setTrsVal(Double trsVal) {
        this.trsVal = trsVal;
    }

    public Double getTrsPl() {
        return trsPl;
    }

    public void setTrsPl(Double trsPl) {
        this.trsPl = trsPl;
    }

    public Double getYtm() {
        return ytm;
    }

    public void setYtm(Double ytm) {
        this.ytm = ytm;
    }

    public Double getModified() {
        return modified;
    }

    public void setModified(Double modified) {
        this.modified = modified;
    }

    public Double getDvbp() {
        return dvbp;
    }

    public void setDvbp(Double dvbp) {
        this.dvbp = dvbp;
    }
}
